package com.candy.excp;

import java.util.Scanner;

public class Test02 {
    //模拟俩个书相除的运算
    public static void main(String[] args) {
        int a;
        int b;
        while (true){
            while (true) {
                Scanner sc = new Scanner(System.in);
                System.out.println("请输入第一个数字：");
                try {
                    a = sc.nextInt();
                    break;
                } catch (Exception e) {
                    System.out.println("您的输入有误,请重新输入：");
                }
            }

            while (true) {
                Scanner sc = new Scanner(System.in);
                System.out.println("请输入第二个数字：");
                try {
                    b = sc.nextInt();
                    break;
                } catch (Exception e) {
                    System.out.println("您的输入有误,请重新输入：");
                }
            }
            if(b==0){
                System.out.println("除数不能为0");
                continue;
            }
            System.out.println("俩个数字相除的结果为:"+(a/b));
            break;
        }
    }
}
